package com.sinaapp.aidaka.server.utils;

import java.sql.Connection;
import java.sql.SQLException;

import javax.sql.DataSource;


public class ConnectionFactory {
	
	public static ConnectionFactory I = new ConnectionFactory();
	private DataSource dataSource;
	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}
	public DataSource getDataSource() {
		return dataSource;
	}

	private ConnectionFactory() {
	}
	public void init(DataSource dataSource) {
		this.dataSource = dataSource;
	}
	
	public Connection getConnection() throws SQLException {
		return dataSource.getConnection();
	}
}
